﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace EntitiesTM
{
    public class EnDate
    {
        public string mon { get; set; }
        public string tue { get; set; }
        public string wed { get; set; }
        public string thu { get; set; }
        public string fri { get; set; }
        public string sat { get; set; }
        public string sun { get; set; }

        public EnDate() { }

        public EnDate(DateTime date)
        {
            int day = (int)date.DayOfWeek;
            DateTime dt =  date.AddDays(1 - day);
            this.mon = dt.ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.tue = dt.AddDays(1).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.wed = dt.AddDays(2).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.thu = dt.AddDays(3).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.fri = dt.AddDays(4).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.sat = dt.AddDays(5).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
            this.sun = dt.AddDays(6).ToString("dddd dd/MM", new CultureInfo("vi-VN"));
        }

        public EnDate(DateTime date, bool value)
        {
            int day = (int)date.DayOfWeek;
            DateTime dt = date.AddDays(1 - day);
            this.mon = dt.ToString("dddd", new CultureInfo("vi-VN"));
            this.tue = dt.AddDays(1).ToString("dddd", new CultureInfo("vi-VN"));
            this.wed = dt.AddDays(2).ToString("dddd", new CultureInfo("vi-VN"));
            this.thu = dt.AddDays(3).ToString("dddd", new CultureInfo("vi-VN"));
            this.fri = dt.AddDays(4).ToString("dddd", new CultureInfo("vi-VN"));
            this.sat = dt.AddDays(5).ToString("dddd", new CultureInfo("vi-VN"));
            this.sun = dt.AddDays(6).ToString("dddd", new CultureInfo("vi-VN"));
        }
    }
}
